package org.example.service;

import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;

/**
 * @Author 李荣
 * @Date 2025/1/3
 * @Description
 */
public interface MqttService {

    void connect() throws MqttException;
    void disconnect() throws MqttException;
    void subscribe(String topic) throws MqttException; // 订阅主题方法
    void publish(String topic, MqttMessage message) throws MqttException; //发布消息
    void close() throws MqttException;
}
